﻿using fmtx.Framework.NoSqlHelper;
using PressureTest.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PressureTest.AppCode
{
    public class TimeLogService
    {
        MongoOperation<TimeLog> tlobj = new MongoOperation<TimeLog>();
        public DateTime Get()
        {
            DateTime res;
            var time = tlobj.Load("TimeLog_begin");
            if (time!=null)
            {
                res = time.Time;
            }
            else
            {
                res = DateTime.Now;
            }
            return res;
        }

        public void Save()
        {
            tlobj.MongoCollection.Save(new TimeLog());
        }
    }
}
